/**
 * Created by linxiaofen on 2017/3/22.
 */
'use strict';
app.service('modalService',['$uibModal',function($uibModal){
     this.showModal = function (message){
            var modalInstance = $uibModal.open({
                ariaLabelledBy: 'modal-title',
                ariaDescribedBy: 'modal-body',
                templateUrl: 'myModalContent.html',
                controller: 'ModalInstanceCtrl',
                controllerAs: '$ctrl',
                resolve: {
                    message: function () {
                        return message;
                    }
                }
            });
            return modalInstance;
        }
    }]);
app.controller('ModalInstanceCtrl', function ($uibModalInstance, message) {
    var $ctrl = this;
    $ctrl.message = message;
    $ctrl.ok = function () {
        $uibModalInstance.close();
    };
    $ctrl.cancel = function () {
        $uibModalInstance.dismiss('cancel');
    };
});